package features;

import javax.swing.tree.DefaultMutableTreeNode;

import operationSolids.CompoundSolid;
import operationSolids.OperationCylinder;
import CAD.MainFrame;

public class Boss extends Feature{

	double height;
	Object topCondition;// oque eh 
	Object filletRadius;// oque eh 
	
	public Boss(int type, Feature Mother, float posx, float posy, float posz, String name,int face) {
		super(type, Mother, name);
		//feature = new OperatioBoss(); implemnetar
		create(posx,posy,posz,face);
		MainFrame.features.add(this);
		MainFrame.refreshJTree();
	}
	
	@Override
	void compound() {
		MainFrame.block  = new Block ("comp",CompoundSolid.UNION,MainFrame.block, feature);
	}
	@Override
	void translate() 	
	{
		feature.translate(placement.getX(), placement.getY() + height/2, placement.getZ());	
	switch (MainFrame.Face) 
	{
	case MainFrame.BACKFACE:
		feature.translate(-MainFrame.block.width/2, MainFrame.block.length/2,MainFrame.block.height/2);
		break;
	case MainFrame.FRONTFACE:
		feature.translate(-MainFrame.block.width/2, MainFrame.block.length/2,MainFrame.block.height/2);
		break;
	case MainFrame.EASTFACE:
		feature.translate(-MainFrame.block.length/2,MainFrame.block.width/2,MainFrame.block.height/2 );
		break;
	case MainFrame.WESTFACE:
		feature.translate(-MainFrame.block.length/2,MainFrame.block.width/2,MainFrame.block.height/2 );
		break;
	case MainFrame.LOWERFACE:
		feature.translate(-MainFrame.block.width/2, MainFrame.block.height/2,MainFrame.block.length/2);
		break;
	case MainFrame.TOPFACE:
		feature.translate(-MainFrame.block.width/2, MainFrame.block.height/2,MainFrame.block.length/2);
		break;

	default:
		System.out.println("erro");
		break;
	}
	
	}

	@Override
	public void drawNode(DefaultMutableTreeNode node) {
		node.add(
				new DefaultMutableTreeNode(
				"Height 1:"+height+"mm")
				);
	}
}
